<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>Document</title>
    <style>
      @property --main-color {
        syntax: "<color>";
        inherits: false;
        initial-value: #48ff00;
      }
      /* CSS变量声明 */
      :root {
        --box-color: #ff0000;
      }
      .box {
        width: 100px;
        height: 100px;
        background-color: var(--box-color);
      }
      .main {
        background-color: var(--main-color);
        padding: 35px;
      }
    </style>
  </head>
  <body>
    <div class="main">
      <div class="box"></div>
    </div>
  </body>
</html>
